#pragma once

#ifdef _WIN32
#include <windows.h>
#endif

#include <stdio.h>
#include <tchar.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <float.h>
#include <stdarg.h>
#include <cmath>

#pragma warning (disable : 4251)

namespace Myway
{

#if defined _WIN32
#define MW_PLATFORM_WIN32
#elif defined _IOS
#define MW_PLAYFORM_IOS
#endif


#ifndef NULL
#define NULL				0
#endif

#ifndef FALSE
#define FALSE               0
#endif

#ifndef TRUE
#define TRUE                1
#endif

#ifdef MW_EXPORT

#define MW_ENTRY __declspec(dllexport)

#else

#define MW_ENTRY __declspec(dllimport)

#endif
    
#define DEFAULT_INCREASE_SIZE 10

#ifndef NPOS
#define NPOS                -1
#endif

#define M_RGBA(r, g, b, a)    ((int)(((a) << 24) | ((b) << 16) | ((g) << 8) | (r)))

#define M_RGBA_F(a, r, g, b)  M_RGBA((int)((int)(r * 255), (int)(g * 255), (int)(b * 255), a * 255))

#define M_RGBA_R(c)           ((unsigned int(c) & 0x00FF0000) >> 0)
#define M_RGBA_G(c)           ((unsigned int(c) & 0x0000FF00) >> 8)
#define M_RGBA_B(c)           ((unsigned int(c) & 0x000000FF) >> 16)
#define M_RGBA_A(c)           ((unsigned int(c) & 0xFF000000) >> 24)

#define MEMORY_IN_SYSTEM    0
#define MEMORY_IN_POOL16    16
#define MEMORY_IN_POOL32    32
#define MEMORY_IN_POOL64    64
#define MEMORY_IN_POOL128   128
#define MEMORY_IN_POOL256   256

#define MEMORY_ALIGN_NONE	0
#define MEMORY_ALIGN_4		4
#define MEMORY_ALIGN_8		8
#define MEMORY_ALIGN_16		16
#define MEMORY_ALIGN_32		32

#define MW_ALIGN_ENUM(enumerate) __force_dword_##enumerate = 0x7FFFFFFF

}
